package com.design.designmode.action.vistor;

/**
 * @author hxl
 * @since 2023-04-18
 */
public class Teacher extends Person {
    private int workYear;

    public Teacher(String name, int age, int workYear) {
        super(name, age);

        this.workYear = workYear;
    }

    public int getWorkYear() {
        return workYear;
    }


    @Override
    public void accept(Visitor visitor) {
        visitor.visitTeacher(this);
    }
}
